<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>公众号参数设置</title>
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap/dist/css/bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/animate.css/animate.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/font-awesome/css/font-awesome.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/simple-line-icons/css/simple-line-icons.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/bootstrap-editable/css/bootstrap-editable.min.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/font.css" type="text/css" />
    <link rel="stylesheet" href="__ADMIN_STATICS__/app/css/app.css" type="text/css" />
</head>
<body>
<div class="wrapper-md">
   <div class="panel panel-default">
    <div class="panel-heading">
        <a href=""><i class="fa fa-home"></i>&nbsp;首页</a>&nbsp;&gt;&nbsp;&nbsp;公众号参数设置
    </div>
    <div class="table-responsive">
        <form class="form-horizontal" action="{:U('Admin/Config/save',array('type'=>wechat))}" method="post">
            <ul class="nav nav-tabs text-center" role="tablist">
                <li role="presentation" class="active"><a href="#wechat" aria-controls="wechat" role="tab" data-toggle="tab">接口配置</a></li>
                <li role="presentation"><a href="#focusReply" aria-controls="focusReply" role="tab" data-toggle="tab">帮助信息配置</a></li>
                <li role="presentation"><a href="#focusNotice" aria-controls="focusNotice" role="tab" data-toggle="tab">关注通知</a></li>
            </ul>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="wechat">
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">接口URL</label>
                        <div class="col-sm-6">
                            <p class="form-control-static">http://{$httpHost}/wechat</p>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">token</label>
                        <div class="col-sm-6">
                            <div class="input-group">
                                <input type="text" class="form-control" name="wechat_base_token" value="{$data['wechat_base_token']}">
                                <span class="input-group-btn">
                                    <button class="btn btn-success" id="createNewToken" type="button">生成</button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">appid：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="wechat_base_appid" value="{$data['wechat_base_appid']}">
                        </div>
                    </div>
                      <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">appsecret</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="wechat_base_appsecret" value="{$data['wechat_base_appsecret']}">
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">debug</label>
                        <div class="col-sm-6">
                            <div class="radio">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wechat_base_debug" value="0" <if condition="$data['wechat_base_debug'] eq 0">checked</if>>
                                    <i></i>否
                                </label>
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wechat_base_debug" value="1" <if condition="$data['wechat_base_debug'] eq 1">checked</if>>
                                    <i></i>是
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">logcallback</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="wechat_base_logcallback" value="{$data['wechat_base_logcallback']}">
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">encodingaeskey</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="wechat_base_encodingaeskey" value="{$data['wechat_base_encodingaeskey']}">
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="focusReply">
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">关注回复</label>
                        <div class="col-sm-6">
                            <div class="radio">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wechat_help_text_focus_reply_switch" value="1" <if condition="$data['wechat_help_text_focus_reply_switch'] eq 1">checked</if>>
                                    <i></i>是
                                </label>
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wechat_help_text_focus_reply_switch" value="0" <if condition="$data['wechat_help_text_focus_reply_switch'] eq 0">checked</if>>
                                    <i></i>否
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">匹配不到关键字回复</label>
                        <div class="col-sm-6">
                            <div class="radio">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wecaht_help_text_no_match_reply_switch" value="1" <if condition="$data['wecaht_help_text_no_match_reply_switch'] eq 1">checked</if>>
                                    <i></i>是
                                </label>
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wecaht_help_text_no_match_reply_switch" value="0" <if condition="$data['wecaht_help_text_no_match_reply_switch'] eq 0">checked</if>>
                                    <i></i>否
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">内容</label>
                        <div class="col-sm-6">
                            <textarea class="form-control" name="wechat_help_text_content" rows="10" maxlength="">{$data['wechat_help_text_content']}</textarea>
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane" id="focusNotice">
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">是否通知</label>
                        <div class="col-sm-6">
                            <div class="radio">
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wecaht_focues_notice_switch" value="1" <if condition="$data['wecaht_focues_notice_switch'] eq 1">checked</if>>
                                    <i></i>是
                                </label>
                                <label class="i-checks i-checks-sm">
                                    <input type="radio" name="wecaht_focues_notice_switch" value="0" <if condition="$data['wecaht_focues_notice_switch'] eq 0">checked</if>>
                                    <i></i>否
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">发送到openid：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="wecaht_focues_notice_openid" value="{$data['wecaht_focues_notice_openid']}">
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group m-b-none m-l-none m-r-none">
                        <label class="col-sm-2 control-label" for="input-id-1">模版id：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="wecaht_focues_notice_templateid" value="{$data['wecaht_focues_notice_templateid']}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="line line-dashed b-b line-lg pull-in"></div>
            <div class="col-sm-4 col-sm-offset-2 m-b">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
    </div>
  </div>
</div>
<div class="modal fade" id="bjy-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
         <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    查看二维码
                </h4>
            </div>
            <div class="modal-body">
                <img src='' class="b b-a wrapper-xs bg-white img-responsive">
            </div>
        </div>
    </div>
</div>
<script src="__ADMIN_STATICS__/jquery/jquery.min.js"></script>
<script src="__ADMIN_STATICS__/bootstrap/dist/js/bootstrap.js"></script>
<script type="text/javascript">
    $(function(){
        var chars = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
        var createFlag = false;
        $("#createNewToken").click(function(){

            var token = "";
            for(var i = 0; i < 32 ; i ++) {
                var id = Math.floor(Math.random()*chars.length);
                token += chars[id];
            }
            $('input[name="wechat_base_token"]').val(token);
        });
    });
</script>
</body>
</html>
